-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract readonly method #37524
Extract readonly method #37524
Conversation
src/Features/Core/Portable/ExtractMethod/MethodExtractor.Analyzer.cs
Outdated
Show resolved
Hide resolved
Could I please get a review from @dotnet/roslyn-ide |
src/Features/Core/Portable/ExtractMethod/MethodExtractor.Analyzer.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenReadonlyStructTests.cs
Outdated
Show resolved
Hide resolved
src/Features/Core/Portable/ExtractMethod/MethodExtractor.Analyzer.cs
Outdated
Show resolved
Hide resolved
src/Features/Core/Portable/ExtractMethod/MethodExtractor.Analyzer.cs
Outdated
Show resolved
Hide resolved
Ping @dotnet/roslyn-ide |
bcc9b27
to
1770001
Compare
Seems like I somehow got some 16.4-p1 commits in here by accident so I had to force push to narrow it down to just the commits that actually contain my work. Sorry about that. |
var instanceMemberIsUsed = thisParameterBeingRead != null || isThisParameterWritten; | ||
var shouldBeReadOnly = !isThisParameterWritten | ||
&& thisParameterBeingRead != null | ||
&& thisParameterBeingRead.Type is { TypeKind: TypeKind.Struct, IsReadOnly: false }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why do we have IsReadOnly: false
here. Shouldn't the new method be made readonly when the type of this
is readonly struct?
nvm, I got it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDE change LGTM.
A second compiler team review is needed, and I need to target 16.4 due to the flow analysis changes in this PR. |
Looking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compiler change LGTM Thanks (iteration 7)
Resolves #34647